import * as Service from '../services/login';

export default {

    namespace: 'login',

    state: {
        data: {
        },
    },

    subscriptions: {
        setup({ dispatch, history }) {  // eslint-disable-line
        },
    },

    effects: {
        *login({ payload: values }, { call, put }) {  // eslint-disable-line
            const data = yield call(Service.query, values);
            yield put({ type: 'init', payload: data });
        },
    },

    reducers: {
        init(state, { payload: data }) {
            return { ...state, data };
        },
    },

};
